﻿package mortal.game.view.daily.view
{
    import Message.Client.*;
    import Message.DB.Tables.*;
    import com.mui.controls.*;
    import extend.language.*;
    import mortal.common.global.*;
    import mortal.game.resource.*;
    import mortal.game.view.common.*;
    import mortal.game.view.daily.*;

    public class DailyCommonShowView extends NewDailyShowBaseView
    {
        private var _name:GTextFiled;
        private var _intr:GTextArea;
        private static var _instance:DailyCommonShowView;

        public function DailyCommonShowView()
        {
            return;
        }// end function

        override public function data(param1:TDailyViewConfig, param2:int = 0) : void
        {
            super.data(param1, param2);
            if (param2 == EDailyType._EDailyTypeCopy)
            {
                this._name.text = _data.name;
                this._intr.htmlText = "    " + _data.description;
            }
            else if (param2 == EDailyType._EDailyTypeTask)
            {
                this._name.text = _data.name;
                this._intr.textField.textColor = GlobalStyle.colorLanUint;
                this._intr.htmlText = _data.description;
            }
            else if (param2 == EDailyType._EDailyTypeActivity)
            {
                this._name.text = _data.normalOpenDt == "\"\"" ? ("" + Language.getString(71041)) : (DailyUtil.getTimeStr(_data.normalOpenDt, false));
                this._intr.text = "         " + _data.description;
            }
            return;
        }// end function

        override protected function createDisposedChildrenImpl() : void
        {
            super.createDisposedChildrenImpl();
            pushUIToDisposeVec(UIFactory.bg(-2, 146, 250, 26, this, ImagesConst.RegionTitleBg));
            this._name = UIFactory.gTextField("", 0, 149, 244, 20, this, GlobalStyle.textFormatChen.center());
            this._intr = UIFactory.textArea("", 0, 170, 245, 105, this);
            this._intr.wordWrap = true;
            this.bgUrl = ImagesConst.DailyCommonBg;
            return;
        }// end function

        override protected function disposeImpl(param1:Boolean = true) : void
        {
            super.disposeImpl(param1);
            this._name.dispose(param1);
            this._intr.dispose(param1);
            return;
        }// end function

        public static function get instance() : DailyCommonShowView
        {
            if (!_instance)
            {
                _instance = new DailyCommonShowView;
            }
            return _instance;
        }// end function

        public static function get hasInstance() : Boolean
        {
            return _instance != null;
        }// end function

    }
}
